<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

// 后台需要登录验证的路由组
Route::group(['middleware'=>'admin.auth','prefix'=>'admin','namespace'=>'Admin','as'=>'admin.'],function (){
Route::get('/','AdminController@index')->name('index');
});

// 后台不需要登录验证的路由组
Route::group(['prefix'=>'admin','namespace'=>'Admin','as'=>'admin.'],function (){
Route::get('/login','LoginController@loginFrom')->name('login');
Route::post('/login','LoginController@login')->name('login');
Route::resource('catergory','CatergoryController');
});

